package com.lhj.bootdemo.thread.threadlocal;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author lhj
 * @version 1.0
 * @date 2022/5/23 10:25 下午
 * @description: ThreadLocal demo
 */

public class ThreadLocalDemo01 {


    public static void main(String[] args) {
        for (int i = 0; i < 1000; i++) {
            final int num = i;
            new Thread(new Runnable() {
                @Override
                public void run() {
                    String date = new ThreadLocalDemo01().date(num);
                    System.out.println(date);
                }
            }).start();
        }
    }


    private String date(int seconds) {
        Date date = new Date(1000 * seconds);
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("mm:ss");
        return simpleDateFormat.format(date);
    }
}
